﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace r2mp_DataStructures
{

    /// <summary>
    /// This class is a storage class for a milestone.
    /// It stores the essential information of a milestone as well as time-information 
    /// necessary to create a milestone-diagramm.
    /// </summary>
    public class Milestone
    {
        /// <summary>
        /// A timeshiftSum is the total number of how often the completion-date of a milestone was adaptet.
        /// </summary>
        private int timeshiftSum = 0;

        public int TimeshiftSum
        {
            get { return timeshiftSum; }
            set { timeshiftSum = value; }
        }

        /// <summary>
        /// Name of the milestone.
        /// </summary>
        private String name;

        public String Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// The original date at which the milestone should have been completed.
        /// </summary>
        private DateTime plannedCompletionDate;

        public DateTime PlannedCompletionDate
        {
            get { return plannedCompletionDate; }
            set { plannedCompletionDate = value; }
        }

        /// <summary>
        /// Every entry in this collection represents the number of periods that have to be added or subtracted
        /// to or from the current completion date each period.
        /// </summary>
        private List<int> timeshifts = new List<int>();

        public List<int> Timeshifts
        {
            get { return timeshifts; }
            set { timeshifts = value; }
        }

        public Milestone() { }

        /// <summary>
        /// Constructs a basic milestone
        /// </summary>
        /// <param name="name">The name of the milestone</param>
        /// <param name="plannedCompletionDate">The date when the milestone should be
        /// reached, according to plan</param>
        public Milestone(String name, DateTime plannedCompletionDate)
        {
            this.name = name;
            this.plannedCompletionDate = plannedCompletionDate;
        }
    }
}
